package cn.bdqn.fifthmedic.sys.domapper;

import cn.bdqn.fifthmedic.sys.model.Permission;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @author Yuan
 * @create 2020-02-12 14:35
 */

public interface PermissionDoMapper {
    @Select("SELECT id,pid,cname,url,icon FROM fm_permission WHERE id\n" +
            "IN(SELECT pid FROM fm_role_permission WHERE roleid IN \n" +
            "(SELECT roleid FROM fm_user WHERE id=#{userid} AND isdel=0));")
    List<Permission> getMenu(@Param("userid") Integer userid);
}
